/**
 * Copyright (C), 2020-2020,贵州铭明网络科技有限公司
 * FileName: PosiListInfoBo
 * Author:   杨朝湖
 * Date:     2020/12/8 15:57
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.mm.bo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author Gym
 * @create 2020/12/8
 * @since 1.0.0
 */
@Data
public class PosiListInfoBo {
    /**
     * 查询条件 ：职位名称
     */
    @ApiModelProperty(value = "职位名称", name = "posiName", required = false)
    private String posiName;

    /**
     * 部门Id
     */
    @ApiModelProperty(value = "部门Id", name = "depaId", required = false)
    private String depaId;
    /**
     * 当前页
     */
    @ApiModelProperty(value = "账号或者真实姓名", name = "pageIndex", required = true)
    @NotNull(message = "当前页不能为空")
    @Min(value = 1, message = "当前页最小为1")
    private Integer pageIndex;
    /**
     * 每页数据
     */
    @ApiModelProperty(value = "账号或者真实姓名", name = "pageSize", required = true)
    @NotNull(message = "没有数据不能为空")
    @Min(value = 1, message = "没有数据最小为1")
    private Integer pageSize;

    public Integer getPageIndex() {
        if (pageIndex < 1) {
            pageIndex = 0;
            return pageIndex;
        } else {
            return (pageIndex - 1) * pageSize;
        }
    }

}